package com.fy;

import java.math.BigDecimal;
import java.text.ParseException;
import java.util.Date;

public class test3 {

    public static void main(String[] args) throws ParseException {
        Date date = new Date();
       String newdate2 =  DateUtil.dateToString(date,"yyyy-MM-dd HH:mm:ss");
       String s  = newdate2.substring(newdate2.indexOf(" "));
        String olddate = "2020-04-14 16:40:00";
        String olds  = olddate.substring(olddate.indexOf(" "));
       //for (String l:s){
           System.out.println(s);
           System.out.println(s.trim());
        long new_starttime = com.fy.utils.DateUtil.Stringtime(s.trim());
        long new_endtime = com.fy.utils.DateUtil.Stringtime(olds.trim());
       //}
        System.out.println(new_starttime);
        System.out.println(new_endtime);
        int c;
        c = (int)(new_endtime/new_starttime+0.1);
        int f = Integer.parseInt(new_endtime+"");
        int z = Integer.parseInt(new_starttime+"");
        System.out.println("f==============="+f);
        System.out.println("z================"+z);
        double q =new BigDecimal((float)f/z).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

        if (q>0.9){
            System.out.println("11111111111");
        }else {
            System.out.println("222222222222");
        }
        System.out.println("q==========="+q);
        System.out.println(c);
       /* System.out.println(oldTime);
        System.out.println(newdate);
        System.out.println(newdate2);*/
    }
}
